Automated ammunition handling systems under development for use aboard next generation self-propelled artillery pieces and weapon systems require a sensor which can automatically provide several safety checks during the firing preparation cycle. For example, prior to ramming an artillery projectile into the gun tube, a visual or some other check must be made to ensure that the bore of the gun tube is clear of obstructions. These pose explosion dangers and could cause severe damage to the gun if left in the gun tube during firing. Further, the ram depth at which a projectile is set in the gun tube just before firing is a critical parameter to be considered for preventing damage to the projectile, breech and gun tube.